package com.yingxin.yxerp.module.dingtalk.entity.enums;

/**
 * 紧急联系人关系
 */

public enum WeComEmergencyContactRelationship {

    ONE( 1, "父母" ),
    TWO( 2, "配偶" ),
    THREE( 3, "子女" ),
    FOUR( 4, "其他" );

    private Integer relationship;

    private String relationshipName;

    WeComEmergencyContactRelationship(Integer relationship, String relationshipName) {
        this.relationship = relationship;
        this.relationshipName = relationshipName;
    }

    public Integer getRelationship() {
        return relationship;
    }

    public void setRelationship(Integer relationship) {
        this.relationship = relationship;
    }

    public String getRelationshipName() {
        return relationshipName;
    }

    public void setRelationshipName(String relationshipName) {
        this.relationshipName = relationshipName;
    }

    public static WeComEmergencyContactRelationship getEnum(Integer relationship) {
        if( relationship == null ){
            return null;
        }
        for (WeComEmergencyContactRelationship i : WeComEmergencyContactRelationship.values()) {
            if ( i.getRelationship() == relationship ) {
                return i;
            }
        }
        return null;
    }

}
